// To compile this module as a DLL:
//
//                  dmcs /t:library basiclib.cs
//
// To link this DLL to a program written in C#:
//
//                  dmcs /r:basiclib.dll someprogram.cs

using System.Collections.Generic;

namespace Basic 
{  
    using System;

    public class Utils 
    {
        public static void Print(string message, double value, bool comma)
        {
            if(comma)
            {
            	Console.Write(string.Format("{0}{1}\t", message, value));
            }
            else
            {
        	Console.Write(string.Format("{0}{1}", message, value));
            }
        }
        
        public static void Print(string message, bool comma)
        {
            if(comma)
            {
            	Console.Write(string.Format("{0}\t", message));
            }
            else
            {
            	Console.Write(string.Format("{0}", message));
            }
        }
        
    	public static double Read(Queue<double> queue)
    	{
            double result = Double.NaN;
            
    	    if(queue.Count != 0)
	    {
	    	result = queue.Dequeue();
	    }
	    else
	    {
	    	Console.WriteLine("No more data to read, exiting...");
	    	System.Environment.Exit(0);
	    }
	    return result;
    	}      
    }
}

